package entities.concept;

import entities.role.Role;
import entities.vocabulary.Display;

public class UniversalConcept extends Concept{

	Role role = null;
	Concept filler = null;
	
	public UniversalConcept(Role role, Concept filler){
		this.role = role;
		this.filler = filler;
	}
	
	public Concept getFiller(){
		return this.filler;
	}
	
	public Role getRole(){
		return this.role;
	}

	/*@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((filler == null) ? 0 : filler.hashCode());
		result = prime * result + ((role == null) ? 0 : role.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!(obj instanceof UniversalConcept))
			return false;
		UniversalConcept other = (UniversalConcept) obj;
		if (filler == null) {
			if (other.filler != null)
				return false;
		} else if (!filler.equals(other.filler))
			return false;
		if (role == null) {
			if (other.role != null)
				return false;
		} else if (!role.equals(other.role))
			return false;
		return true;
	}*/
	
	@Override
	public String toString() {
		return Display.ALLUNICODE+" " + role.toString() + ".(" + filler.toString() + ")";
	}

	@Override
	public Concept getPrimeCopy() {
		return new UniversalConcept(new Role(this.role.getRoleName() + Concept.PRIME), filler.getPrimeCopy());		
	}
	
}
